<?=View::factory('admin/common/header')?>
<div id="content">
  <div class="breadcrumb">
    <a href="<?=URL::site('/')?>">管理首页</a>
    &raquo; 会员列表
  </div>
  <?=View::factory('admin/common/message')?>
  <div class="box">
    <div class="heading">
      <h1><img src="<?=URL::base()?>images/admin/user-group.png" alt="" /> 会员列表</h1>
    </div>
    <div class="content">
    <table class="list">
      <thead>
        <tr>
          <td class="center autosort" name="member_id">ID</td>
          <td class="left autosort" name="email">邮箱地址</td>
          <td class="left autosort" name="nickname">昵称</td>
          <td class="left autosort" name="reg_time">注册时间</td>
          <td class="left autosort" name="last_time">上次登录</td>
          <td class="left autosort" name="status">状态</td>
          <td class="right">操作</td>
        </tr>
      </thead>
      <tbody>
        <tr class="filter">
          <td class="center"><input type="text" name="member_id" value="<?=$member_id?$member_id:''?>" size="3" /></td>
          <td class="left"><input type="text" name="email" value="<?=$email?>" size="20" /></td>
          <td class="left"><input type="text" name="nickname" value="<?=$nickname?>" size="20" /></td>
          <td class="left"><input type="text" name="reg_time" value="<?=$reg_time?date('Y-m-d', $reg_time):''?>" size="20" class="date" /></td>
          <td class="left">&nbsp;</td>
          <td class="left"><select name="status">
            <option value="all"></option>
            <option value="<?=Member::NORMAL?>" <?=(is_numeric($status)&&$status==Member::NORMAL)?'selected':''?>><?=Member::status(Member::NORMAL, FALSE)?></option>
            <option value="<?=Member::LOCKED?>" <?=$status==Member::LOCKED?'selected':''?>><?=Member::status(Member::LOCKED, FALSE)?></option>
            <option value="<?=Member::NOTACT?>" <?=$status==Member::NOTACT?'selected':''?>><?=Member::status(Member::NOTACT, FALSE)?></option>
          </select></td>
          <td class="right">[ <a onclick="$.filter_clean();">清除</a> ] <input type="button" onclick="$.filter_submit();" class="btn45" value="筛选" /></td>
        </tr>
        <? foreach ($pagination as $member) { ?>
        <tr>
          <td class="center"><?=$member['member_id']?></td>
          <td class="left"><?=Str::highlight($member['email'], $email)?></td>
          <td class="left"><?=Str::highlight($member['nickname'], $nickname)?></td>
          <td class="left"><?=date('Y-m-d H:i', $member['reg_time'])?></td>
          <td class="left"><?=$member['last_time']?date('Y-m-d H:i', $member['last_time']):'&nbsp;'?></td>
          <td class="left"><?=Member::status($member['status'])?></td>
          <td class="right">
            [ <a href="<?=URL::redirect('admin/member/profile/'.$member['member_id'])?>">编辑</a> ]
          </td>
        </tr>
        <? } ?>
      </tbody>
    </table>
    <?=$pagination?>
    </div>
  </div>
</div>
<?=View::factory('admin/common/footer')?>
<script type="text/javascript">
$().ready(function(){
    $('#member').addClass('selected');
    $('.date').datepicker({yearRange: 'c-8:c+1'});
});
</script>